GInputStream *result_stream;
GMainLoop *loop;
GError **error;
- gpointer user_data;
}
FetchUriSyncData;
-static gboolean
-run_mainloop_monitor_fetcher (FetchUriSyncData *data)
-{
- g_main_loop_run (data->loop);
-
- return TRUE;
-}
-
static void
fetch_uri_sync_on_complete (GObject *object,
GAsyncResult *result,
}
gboolean
-_ostree_fetcher_contents_membuf_sync (OstreeFetcher *fetcher,
- SoupURI *uri,
- gboolean add_nul,
- gboolean allow_noent,
- GBytes **out_contents,
- GMainLoop *loop,
- gpointer user_data,
- guint64 max_size,
- GCancellable *cancellable,
- GError **error)
+_ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
+ SoupURI *uri,
+ gboolean add_nul,
+ gboolean allow_noent,
+ GBytes **out_contents,
+ GMainLoop *loop,
+ guint64 max_size,
+ GCancellable *cancellable,
+ GError **error)
{
gboolean ret = FALSE;
const guint8 nulchar = 0;
if (g_cancellable_set_error_if_cancelled (cancellable, error))
return FALSE;
- data.user_data = user_data;
data.loop = loop;
data.error = error;
cancellable,
fetch_uri_sync_on_complete, &data);
- run_mainloop_monitor_fetcher (&data);
+ g_main_loop_run (loop);
if (!data.result_stream)
{
if (allow_noent)
GAsyncResult *result,
GError **error);
-gboolean _ostree_fetcher_contents_membuf_sync (OstreeFetcher *fetcher,
- SoupURI *uri,
- gboolean add_nul,
- gboolean allow_noent,
- GBytes **out_contents,
- GMainLoop *loop,
- gpointer user_data,
- guint64 max_size,
- GCancellable *cancellable,
- GError **error);
+gboolean _ostree_fetcher_request_uri_to_membuf (OstreeFetcher *fetcher,
+ SoupURI *uri,
+ gboolean add_nul,
+ gboolean allow_noent,
+ GBytes **out_contents,
+ GMainLoop *loop,
+ guint64 max_size,
+ GCancellable *cancellable,
+ GError **error);
G_END_DECLS
#endif
g_task_set_task_data (task, request, ostree_metalink_request_unref);
- if (! _ostree_fetcher_contents_membuf_sync (self->fetcher,
- self->uri,
- FALSE,
- FALSE,
- &out_contents,
- loop,
- NULL,
- self->max_size,
- cancellable,
- error))
+ if (! _ostree_fetcher_request_uri_to_membuf (self->fetcher,
+ self->uri,
+ FALSE,
+ FALSE,
+ &out_contents,
+ loop,
+ self->max_size,
+ cancellable,
+ error))
goto out;
if (! on_metalink_bytes_read (request, request, &data, out_contents, error))
{
gboolean ret;
pull_data->fetching_sync_uri = uri;
- ret = _ostree_fetcher_contents_membuf_sync (pull_data->fetcher,
- uri,
- add_nul,
- allow_noent,
- out_contents,
- pull_data->loop,
- pull_data,
- OSTREE_MAX_METADATA_SIZE,
- cancellable,
- error);
+ ret = _ostree_fetcher_request_uri_to_membuf (pull_data->fetcher,
+ uri,
+ add_nul,
+ allow_noent,
+ out_contents,
+ pull_data->loop,
+ OSTREE_MAX_METADATA_SIZE,
+ cancellable,
+ error);
pull_data->fetching_sync_uri = NULL;
return ret;
}